{{-- resources\views\home\nav.blade.php --}}
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo03"
    aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="/">{{env('USER_NAME')}}的博客</a>

<div class="collapse navbar-collapse" id="navbarTogglerDemo03">
    <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
        <li class="nav-item active">
            <a class="nav-link" href="/">主页 <span class="sr-only">(current)</span></a>
        </li>
        <li class="nav-item">
            @php
            // 判断是否登录
            if (session('uEmail', 'null') == 'null') {
            echo '<a class="nav-link" href="/login">登录</a>';
            }else {
            echo '<a class="nav-link" href="/logout">登出</a>';
            }
            @endphp
        </li>
        <li class="nav-item">
            @php
            // 判断是否登录
            if (session('uEmail', 'null') == 'null') {
            echo '<a class="nav-link disabled" href="/admin">管理</a>';
            }else {
            echo '<a class="nav-link" href="/admin">管理</a>';
            }
            @endphp
        </li>
        <li>
            @php
            // 判断是否登录
            if (session('uEmail', 'null') == 'null') {
            echo '';
            }else {
            echo '<a class="nav-link" href="/adminInsert">发布文章</a>';
            }
            @endphp
        </li>
    </ul>
    <form class="form-inline my-2 my-lg-0" action="/search" method="GET">
        <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search" name="q">
        <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
    </form>
</div>